(function (angular) {
    'use strict';
    angular.module('fs.dialog', ['ui.bootstrap', 'fs.router', 'fs.common', 'cfp.hotkeys']);
    angular.module('fs.dialog').run(templateConfig);
    templateConfig.$inject = ["$templateCache"];
    function templateConfig($templateCache) {
        $templateCache.put('fs/template/modal/acknowledge.html', '' +
            '<div class="acknowledgeDialog app-modal-content {{vm.dialogsOptions.level}}">\n' +
            '    <div class="modal-header">\n' +
            '        <button type="button" class="close" data-dismiss="alert" aria-label="Close" ng-click="vm.close()"><span aria-hidden="true" class="icon icon-close"></span></button><i ng-show="vm.dialogsOptions.icon" class="icon icon-{{vm.dialogsOptions.icon}}"></i><label class="modal-title" id="modal-title">{{vm.title|translate}}</label>\n' +
            '    </div>\n' +
            '    <div class="modal-body panel jumbotron" id="modal-body" ng-style="vm.dialogsOptions.bodyStyle">\n' +
            '             <div ng-repeat="message in vm.messages"><i class="icon icon-{{vm.dialogsOptions.icon}}"></i><span>{{message | translate }}</span></div>\n' +
            '             <div ng-show="vm.redirections && vm.redirections.length > 0"><label>Goto:</label> <a href="#" ng-click="vm.redirect(redirection)" ng-repeat="redirection in vm.redirections"><span>{{redirection.name | translate }}</span></a></div>\n' +
            '    </div>\n' +
            '    <div class="modal-footer">\n' +
            '        <fs-button fs-button-config="button" fs-button-group="true" ng-repeat="button in vm.closeButtons"/>\n' +
            '    </div>\n' +
            '</div>\n');

        $templateCache.put('fs/template/modal/jump.html', '' +
            '<div class="acknowledgeDialog app-modal-content {{vm.dialogsOptions.level}}">\n' +
            '    <div class="modal-header">\n' +
            '        <button type="button" class="close" data-dismiss="alert" aria-label="Close" ng-click="vm.close()"><span aria-hidden="true" class="icon icon-close"></span></button><i ng-show="vm.dialogsOptions.icon" class="icon icon-{{vm.dialogsOptions.icon}}"></i><label class="modal-title" id="modal-title">{{vm.title|translate}}</label>\n' +
            '    </div>\n' +
            '    <div class="modal-body panel jumbotron" id="modal-body" ng-style="vm.dialogsOptions.bodyStyle">\n' +
            '             <div ng-repeat="message in vm.messages"><span>{{message | translate }}</span></div>\n' +
            '             <div><label>Goto:</label> <a href="#" ng-click="vm.jump(redirection)" ng-repeat="redirection in vm.redirections"><span>{{redirection.name | translate }}</span></a></div>\n' +
            '    </div>\n' +
            '    <div class="modal-footer btn-group-sm">\n' +
            '        <fs-button fs-button-config="button" fs-button-group="true" ng-repeat="button in vm.closeButtons"/>\n' +
            '    </div>\n' +
            '</div>\n');

        $templateCache.put('fs/template/modal/messages.html', '' +
            '<div class="messageDialog app-modal-content {{vm.dialogsOptions.level}}" ng-click="vm.dialogsOptions.cancelAutoClose = true;">\n' +
            '    <div class="modal-header">\n' +
            '        <button type="button" class="close" data-dismiss="alert" aria-label="Close" ng-click="vm.close()"><span aria-hidden="true" class="icon icon-close"></span></button>\n' +
            '        <i ng-show="vm.dialogsOptions.icon" class="icon icon-{{vm.dialogsOptions.icon}}"></i>\n' +
            '        <span class="modal-title" id="modal-title">{{vm.title|translate}}</span>\n' +
            '    </div>\n' +
            '    <div class="modal-body panel" id="modal-body" ng-style="vm.dialogsOptions.bodyStyle">\n' +
            '         <ul class="list-unstyled">\n' +
            '             <li ng-repeat="message in vm.messages"><span ng-bind-html="message | translate | trustedHtml"></span></li>\n' +
            '         </ul>\n' +
            '    </div>\n' +
            '    <div class="modal-footer btn-group-sm" ng-if="!vm.dialogsModule.autoClose">\n' +
            '        <fs-button ng-if="vm.dialogsOptions.bottomOkBtn" fs-button-config="button" fs-button-group="true" ng-repeat="button in vm.okButtons"/>\n' +
            '        <fs-button ng-if="!vm.dialogsOptions.bottomOkBtn" fs-button-config="button" fs-button-group="true" ng-repeat="button in vm.closeButtons"/>\n' +
            '    </div>\n' +
            '</div>\n');
        $templateCache.put('fs/template/modal/logMessages.html', '' +
            '<div class="logDialog app-modal-content {{vm.dialogsOptions.level}}">\n' +
            '    <div class="modal-header">\n' +
            '        <button type="button" class="close" data-dismiss="alert" aria-label="Close" ng-click="vm.close()"><span aria-hidden="true" class="icon icon-close"></span></button><label class="modal-title" id="modal-title">{{vm.title|translate}}</label>\n' +
            '    </div>\n' +
            '    <div class="modal-body panel" id="modal-body" ng-style="vm.dialogsOptions.bodyStyle">\n' +
            '       <textarea class="form-control input-sm" rows="20"><span>{{::vm.messages}}</span></textarea>\n' +
            '    </div>\n' +
            '    <div class="modal-footer btn-group-sm">\n' +
            '        <fs-button fs-button-config="button" fs-button-group="true" ng-repeat="button in vm.closeButtons"/>\n' +
            '    </div>\n' +
            '</div>\n');

        $templateCache.put('fs/template/modal/confirmMessages.html', '' +
            '<div class="confirmDialog app-modal-content {{vm.dialogsOptions.level}}">\n' +
            '    <div class="modal-header">\n' +
            '       <button type="button" class="close" data-dismiss="alert" aria-label="Close" ng-click="vm.close()"><span aria-hidden="true" class="icon icon-close"></span></button><i ng-show="vm.dialogsOptions.icon" class="icon icon-{{vm.dialogsOptions.icon}}"></i><span class="modal-title" id="modal-title">{{vm.title|translate}}</span>\n' +
            '    </div>\n' +
            '    <div class="modal-body panel" id="modal-body" ng-style="vm.dialogsOptions.bodyStyle">\n' +
            '         <ul class="list-unstyled">\n' +
            '             <li ng-repeat="message in vm.messages"><span>{{message | translate }}</span></li>\n' +
            '         </ul>\n</b>' +
            '    </div>\n' +
            '    <div class="modal-footer">\n' +
            '        <fs-button fs-button-config="button" fs-button-group="true" ng-repeat="button in vm.okAndCloseButtons"/>\n' +
            '    </div>\n' +
            '</div>\n');

        $templateCache.put('fs/template/modal/promptInput.html', '' +
            '<div class="promptInputDialog app-modal-content {{vm.dialogsOptions.level}}">\n' +
            '    <div class="modal-header">\n' +
            '        <button type="button" class="close" data-dismiss="alert" aria-label="Close" ng-click="vm.close()"><span aria-hidden="true" class="icon icon-close"></span></button><i ng-show="vm.dialogsOptions.icon" class="icon icon-{{vm.dialogsOptions.icon}}"></i><span class="modal-title" id="modal-title">{{vm.title|translate}}</span>\n' +
            '    </div>\n' +
            '    <div class="modal-body panel" id="modal-body" ng-style="vm.dialogsOptions.bodyStyle">\n' +
            '       <div class="panel-body"><textarea class="form-control input-sm" rows="5" ng-model="vm.promptMessage"></textarea></div>\n' +
            '    </div>\n' +
            '    <div class="modal-footer">\n' +
            '		 <fs-button fs-button-config="button" fs-button-group="true" ng-repeat="button in vm.promptOkAndCloseButtons"/>' +
            '    </div>\n' +
            '</div>\n');

        $templateCache.put('fs/template/modal/custormer.html', '' +
            '<div ng-form name="{{::vm.formName}}" disableUnloadCheck="{{::vm.disableUnloadCheck}}" class="custormerDialog app-modal-content {{vm.dialogsModule.level}}">\n' +
            '    <div class="modal-header">\n' +
            '        <button type="button" class="close" data-dismiss="alert" aria-label="Close" ng-click="vm.close != undefined ? vm.close() : vm.ok()"><span aria-hidden="true" class="icon icon-close"></span></button><i ng-show="vm.dialogsModule.icon" class="icon icon-{{vm.dialogsModule.icon}}"></i><span class="modal-title" id="modal-title">{{vm.dialogsModule.title|translate}}</span>\n' +
            '    </div>\n' +
            '    <div class="modal-body panel" id="modal-body" ng-style="vm.dialogsModule.bodyStyle">\n' +
            '         <div ng-include="vm.dialogsModule.templateUrl"></div>\n' +
            '    </div>\n' +
            '    <div class="modal-footer">\n' +
            '        <button class="btn btn-default" type="button" ng-if="vm.close != undefined" ng-click="vm.close()"><span class="icon icon-close"></span><span>{{"button.text.close"|translate}}</span></button>\n' +
            '        <button class="btn btn-primary" type="button" ng-if="vm.ok != undefined" ng-click="vm.dialogsModule.disableButton($event);vm.ok()"><span class="icon icon-ok"></span><span>{{"button.text.ok"|translate}}</span></button>\n' +
            '    </div>\n' +
            '</div>\n');
        $templateCache.put('fs/template/modal/dashboard/panel.html', '' +
            '<div class="custormerDialog">\n' +
            '    <div class="modal-content" id="modal-body" ng-style="panelController.panelConfig.bodyStyle" ng-include="panelController.panelConfig.dashboardTemplateUrl">\n' +
            '    </div>\n' +
            '</div>\n');
    }
})(angular);